home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
005
/
miscstat.arc
/
STUTDSTT.BAS
< prev
Wrap
BASIC Source File
|
1986-04-25
|
2KB
|
59 lines
1 'STUdent's T-DiSTribution Test
2 KEY OFF:SCREEN 0,1,0:WIDTH 40:COLOR 15,1,9:CLS
10 PRINT "STUDENT'S T-DISTRIBUTION TEST"
20 PRINT
30 DIM P(10,2)
40 DIM V(2),R(2),M(2),D(2)
50 PRINT "TEST 1: MEAN=X"
60 PRINT "TEST 2: MEAN=MEAN, STANDARD DEVIATION=
62 PRINT " STANDARD DEVIATION
70 PRINT "TEST 3: MEAN=MEAN, STANDARD DEVIATION<>
72 PRINT " STANDARD DEVIATION
80 PRINT:PRINT "WHICH HYPOTHESIS: ";:LOCATE ,,1:T=0
90 K$=INKEY$:IF K$="" THEN 90
91 IF K$=CHR$(13) AND T THEN PRINT:GOTO 100
92 IF K$=CHR$(27) THEN 450
94 IF K$<"1" OR K$>"3" THEN 90
96 T=VAL(K$):PRINT K$;:GOTO 90
100 PRINT
110 FOR I = 1 TO SGN (T - 1) + 1
120 V(I) = 0
130 D(I) = 0
140 PRINT "SAMPLE";I;":"
150 PRINT " NUMBER OF ELEMENTS";
160 INPUT R(I)
170 FOR J = 1 TO R(I)
180 PRINT " ELEMENT"J;
190 INPUT P(J,I)
200 V(I) = V(I) + P(J,I)
210 D(I) = D(I) + P(J,I) ^ 2
220 NEXT J
230 M(I) = V(I) / R(I)
240 V(I) = (D(I) - V(I) ^ 2 / R(I)) / (R(I) - 1)
250 NEXT I
260 PRINT
270 IF T = 2 THEN 340
280 IF T = 3 THEN 380
290 PRINT "VALUE OF MEAN";
300 INPUT M
310 A = (M(1) - M) * SQR (R(1) / V(1))
320 B = R(1) - 1
330 GOTO 420
340 A = (M(1) - M(2)) / SQR (1 / R(1) + 1 / R(2))
350 B = R(1) + R(2) - 2
360 A = A / SQR (((R(1) - 1) * V(1) + (R(2) - 1) * V(2)) / B)
370 GOTO 420
380 A = (M(1) - M(2)) / SQR (V(1) / R(1) + V(2) / R(2))
390 B = (V(1) / R(1) + V(2) / R(2)) ^ 2
400 B = B / ((V(1) / R(1)) ^ 2 / (R(1) + 1) + (V(2) / R(2)) ^ 2 / (R(2) + 1)) - 2
410 B = INT (B + .5)
420 PRINT
430 PRINT "T-VALUE: " ABS (A)
440 PRINT "DEGREES OF FREEDOM: "B
450 PRINT:LOCATE 24,1:PRINT"PRESS <SPACE> TO RUN AGAIN";
460 LOCATE 25,1:PRINT"PRESS <ESC> TO EXIT";
470 K$=INKEY$:IF K$="" THEN 470
480 IF K$=" " THEN RUN
490 IF K$<>CHR$(27) THEN 470
10000 RUN"MENU